Skip to contentSkip to conversation

Change in openvpn[master]: configure: Switch to C11 by default

Openvpn-devel In review flichtenheld (Code Review) 3 participants 9 messages Jul 9, 2024 – Jul 17, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1720531952000.I72934e747d1ad68a7e3675afbeb1b63df7941186@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/673?usp=email

to review the following change.

Change subject: configure: Switch to C11 by default
......................................................................

configure: Switch to C11 by default

Mostly so we can use anonymous structs without jumping through hoops or relying on unofficial support.

Change-Id I72934e747d1ad68a7e3675afbeb1b63df7941186

---
M CMakeLists.txt
M configure.ac

2 files changed, 3 insertions(+), 3 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/73/673/1

CMakeLists.txt +1 -1
index f8b37a9..6f8bc72 100644
@@ -119,7 +119,7 @@
 set(OPENVPN_VERSION_PATCH ${PRODUCT_VERSION_PATCH})
 set(OPENVPN_VERSION_RESOURCE ${PRODUCT_VERSION_RESOURCE})
 
-set(CMAKE_C_STANDARD 99)
+set(CMAKE_C_STANDARD 11)
 
 # Set the various defines for config.h.cmake.in
 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
configure.ac +2 -2
index 5f72029..de67a08 100644
@@ -421,10 +421,10 @@
 AC_CHECK_PROGS([RST2HTML], [rst2html rst2html.py])
 AM_CONDITIONAL([HAVE_PYDOCUTILS], [test "${RST2MAN}" -a "${RST2HTML}"])
 
-# Set -std=c99 unless user already specified a -std=
+# Set -std=c11 unless user already specified a -std=
 case "${CFLAGS}" in
   *-std=*) ;;
-  *)       CFLAGS="${CFLAGS} -std=c99" ;;
+  *)       CFLAGS="${CFLAGS} -std=c11" ;;
 esac
 
 #

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/673?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I72934e747d1ad68a7e3675afbeb1b63df7941186
Gerrit-Change-Number: 673
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld.

plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/673?usp=email )

Change subject: configure: Switch to C11 by default
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/673?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I72934e747d1ad68a7e3675afbeb1b63df7941186
Gerrit-Change-Number: 673
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Tue, 09 Jul 2024 13:33:32 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#3 lore raw

PATCH v2 1/1 configure: Switch to C11 by default

In reply to a message not in the archive

Mostly so we can use anonymous structs without jumping through hoops or relying on unofficial support.

Change-Id I72934e747d1ad68a7e3675afbeb1b63df7941186

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/673
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Arne Schwabe <[email protected]...>

CMakeLists.txt +1 -1
index 096837d..ad620fa 100644
@@ -119,7 +119,7 @@
 set(OPENVPN_VERSION_PATCH ${PRODUCT_VERSION_PATCH})
 set(OPENVPN_VERSION_RESOURCE ${PRODUCT_VERSION_RESOURCE})
 
-set(CMAKE_C_STANDARD 99)
+set(CMAKE_C_STANDARD 11)
 
 # Set the various defines for config.h.cmake.in
 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
configure.ac +2 -2
index 1f03f90..dcc46e2 100644
@@ -421,10 +421,10 @@
 AC_CHECK_PROGS([RST2HTML], [rst2html rst2html.py])
 AM_CONDITIONAL([HAVE_PYDOCUTILS], [test "${RST2MAN}" -a "${RST2HTML}"])
 
-# Set -std=c99 unless user already specified a -std=
+# Set -std=c11 unless user already specified a -std=
 case "${CFLAGS}" in
   *-std=*) ;;
-  *)       CFLAGS="${CFLAGS} -std=c99" ;;
+  *)       CFLAGS="${CFLAGS} -std=c11" ;;
 esac
 
 #
#4 lore raw

Re: [Openvpn-devel] [PATCH v2] configure: Switch to C11 by default

Hi,

Quoted 10 lines · Frank Lichtenheld

Mostly so we can use anonymous structs without jumping through hoops or relying on unofficial support.

Change-Id I72934e747d1ad68a7e3675afbeb1b63df7941186

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

This breaks all OpenBSD 6.8 builds. Are you intentionally ignoring this ("this OS is out of support, we'll discontinue this buildbot"? If yes, we might want to point out that this change has fallout on older "build environments" - not sure what is problematic here, C compiler or system headers, or libc...

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#5 lore raw

Re: [Openvpn-devel] [PATCH v2] configure: Switch to C11 by default

Quoted 11 lines · Gert Doering

Hi,

Quoted 8 lines · Frank Lichtenheld

Mostly so we can use anonymous structs without jumping through hoops or relying on unofficial support.

Change-Id I72934e747d1ad68a7e3675afbeb1b63df7941186

---

Quoted 8 lines
Quoted 2 lines

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

This breaks all OpenBSD 6.8 builds. Are you intentionally ignoring this ("this OS is out of support, we'll discontinue this buildbot"? If yes, we might want to point out that this change has fallout on older "build environments" - not sure what is problematic here, C compiler or system headers, or libc...

Yes, ignoring that intentionally. I plan to disable OpenBSD 6.8 builds for master instead.

Basically the intent of this patch is to approve
https://gerrit.openvpn.net/c/openvpn/+/588 (Remove check for anonymous unions from configure and cmake config) but improve it by officially switching to C11 (which implies support for anonymous unions).

We can certainly extend the messaging.

Regards,

Signature · 1 line
  Frank Lichtenheld
#6 lore raw

[Openvpn-devel] [PATCH applied] Re: configure: Switch to C11 by default

In reply to Frank Lichtenheld

As discussed before, this breaks OpenBSD 6.8 builds (and, generally, other systems with very old compilers). Not sure the benefit of getting rid of a few hoops for anonymous unions is worth it, but then, it's not like people on those systems couldn't just update...

Your patch has been applied to the master branch.

commit 37b696a207548df88fe65aa130fe6d522e7ce920 (master)

Author: Frank Lichtenheld
Date:   Wed Jul 10 18:03:06 2024 +0200
     configure: Switch to C11 by default

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Arne Schwabe <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg28916.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#7 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

Hello plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/673?usp=email

to look at the new patch set (#3).

The following approvals got outdated and were removed:
Code-Review+2 by plaisthos

The change is no longer submittable: Code-Review and checks~ChecksSubmitRule are unsatisfied now.

Change subject: configure: Switch to C11 by default
......................................................................

configure: Switch to C11 by default

Mostly so we can use anonymous structs without jumping through hoops or relying on unofficial support.

Change-Id I72934e747d1ad68a7e3675afbeb1b63df7941186

---
M CMakeLists.txt
M Changes.rst
M configure.ac

3 files changed, 9 insertions(+), 3 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/73/673/3

CMakeLists.txt +1 -1
index 096837d..ad620fa 100644
@@ -119,7 +119,7 @@
 set(OPENVPN_VERSION_PATCH ${PRODUCT_VERSION_PATCH})
 set(OPENVPN_VERSION_RESOURCE ${PRODUCT_VERSION_RESOURCE})
 
-set(CMAKE_C_STANDARD 99)
+set(CMAKE_C_STANDARD 11)
 
 # Set the various defines for config.h.cmake.in
 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
Changes.rst +6 -0
index 439352a..0a26dca 100644
@@ -42,6 +42,12 @@
     ``--topology net30`` to the config should fix the problem.
     By default ``--topology`` is pushed from server to client.
 
+Default C standard to follow was updated to C11.
+    The work-around for compilers that do not support anonymous unions was
+    removed. All currently supported versions of our target platforms should
+    have compilers that can handle C11. The platform that got support
+    most recently seems to be OpenBSD (default gcc).
+
 OpenSSL 1.0.2 support
     Support for building with OpenSSL 1.0.2 has been removed. The minimum
     supported OpenSSL version is now 1.1.0.
configure.ac +2 -2
index 1f03f90..dcc46e2 100644
@@ -421,10 +421,10 @@
 AC_CHECK_PROGS([RST2HTML], [rst2html rst2html.py])
 AM_CONDITIONAL([HAVE_PYDOCUTILS], [test "${RST2MAN}" -a "${RST2HTML}"])
 
-# Set -std=c99 unless user already specified a -std=
+# Set -std=c11 unless user already specified a -std=
 case "${CFLAGS}" in
   *-std=*) ;;
-  *)       CFLAGS="${CFLAGS} -std=c99" ;;
+  *)       CFLAGS="${CFLAGS} -std=c11" ;;
 esac
 
 #

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/673?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I72934e747d1ad68a7e3675afbeb1b63df7941186
Gerrit-Change-Number: 673
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset

#8 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#4) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/673?usp=email )

Change subject: configure: Switch to C11 by default
......................................................................

configure: Switch to C11 by default

Mostly so we can use anonymous structs without jumping through hoops or relying on unofficial support.

Change-Id I72934e747d1ad68a7e3675afbeb1b63df7941186

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg28916.html

---
M CMakeLists.txt
M configure.ac

2 files changed, 3 insertions(+), 3 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/73/673/4

CMakeLists.txt +1 -1
index 096837d..ad620fa 100644
@@ -119,7 +119,7 @@
 set(OPENVPN_VERSION_PATCH ${PRODUCT_VERSION_PATCH})
 set(OPENVPN_VERSION_RESOURCE ${PRODUCT_VERSION_RESOURCE})
 
-set(CMAKE_C_STANDARD 99)
+set(CMAKE_C_STANDARD 11)
 
 # Set the various defines for config.h.cmake.in
 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
configure.ac +2 -2
index 555c97e..9ce826c 100644
@@ -421,10 +421,10 @@
 AC_CHECK_PROGS([RST2HTML], [rst2html rst2html.py])
 AM_CONDITIONAL([HAVE_PYDOCUTILS], [test "${RST2MAN}" -a "${RST2HTML}"])
 
-# Set -std=c99 unless user already specified a -std=
+# Set -std=c11 unless user already specified a -std=
 case "${CFLAGS}" in
   *-std=*) ;;
-  *)       CFLAGS="${CFLAGS} -std=c99" ;;
+  *)       CFLAGS="${CFLAGS} -std=c11" ;;
 esac
 
 #

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/673?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I72934e747d1ad68a7e3675afbeb1b63df7941186
Gerrit-Change-Number: 673
Gerrit-PatchSet: 4
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#9 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/673?usp=email )

Change subject: configure: Switch to C11 by default
......................................................................

configure: Switch to C11 by default

Mostly so we can use anonymous structs without jumping through hoops or relying on unofficial support.

Change-Id I72934e747d1ad68a7e3675afbeb1b63df7941186

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg28916.html

---
M CMakeLists.txt
M configure.ac

2 files changed, 3 insertions(+), 3 deletions(-)
CMakeLists.txt +1 -1
index 096837d..ad620fa 100644
@@ -119,7 +119,7 @@
 set(OPENVPN_VERSION_PATCH ${PRODUCT_VERSION_PATCH})
 set(OPENVPN_VERSION_RESOURCE ${PRODUCT_VERSION_RESOURCE})
 
-set(CMAKE_C_STANDARD 99)
+set(CMAKE_C_STANDARD 11)
 
 # Set the various defines for config.h.cmake.in
 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
configure.ac +2 -2
index 555c97e..9ce826c 100644
@@ -421,10 +421,10 @@
 AC_CHECK_PROGS([RST2HTML], [rst2html rst2html.py])
 AM_CONDITIONAL([HAVE_PYDOCUTILS], [test "${RST2MAN}" -a "${RST2HTML}"])
 
-# Set -std=c99 unless user already specified a -std=
+# Set -std=c11 unless user already specified a -std=
 case "${CFLAGS}" in
   *-std=*) ;;
-  *)       CFLAGS="${CFLAGS} -std=c99" ;;
+  *)       CFLAGS="${CFLAGS} -std=c11" ;;
 esac
 
 #

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/673?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I72934e747d1ad68a7e3675afbeb1b63df7941186
Gerrit-Change-Number: 673
Gerrit-PatchSet: 4
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged